<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
  
  <description>
   Bean configuration file for the gwc-wms module
  </description>
  <!-- WMS based services -->
  <bean id="gwcServiceWMSTarget" 
    	class="org.geowebcache.service.wms.WMSService">
    <constructor-arg ref="gwcStorageBroker"/>
	<constructor-arg ref="gwcTLDispatcher"/>
	<constructor-arg ref="gwcRuntimeStats"/>
    <constructor-arg ref="gwcURLMangler"/>
    <constructor-arg ref="geowebcacheDispatcher"/>
    	<!-- Set the next line to true to enable full WMS support,
	     i.e. recombining tiles to serve arbitrary WMS requests -->
    <property name="fullWMS"><value>FALSE</value></property>
    <!-- Proxy unknown requests -->
    <property name="proxyRequests"><value>TRUE</value></property>
    <property name="hintsConfig">
		<value>DEFAULT</value>
	</property>
	<property name="utility" ref="wmsUtilities"/>
    <property name="securityDispatcher" ref="gwcSecurityDispatcher"/>
  </bean>
  
  <bean id="wmsUtilities" class="org.geowebcache.service.wms.WMSUtilities"/>
  
  <bean id="gwcServiceWMSProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
    <property name="targetName">
      <value>gwcServiceWMSTarget</value>
    </property>
    <property name="interceptorNames">
      <list>
          <!-- allow any other advise defined elsewhere and named "gwcServiceWMSInterceptor*" 
               to be added to the interceptors list -->
          <value>gwcServiceWMSInterceptor*</value>
      </list>
    </property>
  </bean>
  <alias name="gwcServiceWMSProxy" alias="gwcServiceWMS"/>

    <bean id="ioInitializer" class="org.geowebcache.io.codec.ImageIOInitializer" factory-method="getInstance">
  		<constructor-arg index="0">
			<list>
				<value>com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriterSpi</value>
				<value>com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi</value>
			</list>
		</constructor-arg>
  	</bean>

	<!--Encoders -->

	<bean id="PNGEncoder" class="org.geowebcache.io.codec.PNGImageEncoder">
		<constructor-arg index="0" value="false" />
		<constructor-arg index="1" value="0.25" />
		<constructor-arg index="2">
			<list>
				<value>com.sun.media.imageioimpl.plugins.png.CLibPNGImageWriterSpi</value>
				<value>com.sun.imageio.plugins.png.PNGImageWriterSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<map>
				<entry key="COMPRESSION" value="FILTERED" />
				<entry key="COMPRESSION_RATE" value="0.75" />
			</map>
		</constructor-arg>
		<constructor-arg index="4" value="false" />
		<constructor-arg ref="ioInitializer" />
	</bean>

	<bean id="GIFEncoder" class="org.geowebcache.io.codec.ImageEncoderImpl">
		<constructor-arg type="boolean" value="true" />
		<constructor-arg>
			<list>
				<value>image/gif</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<list>
				<value>com.sun.media.imageioimpl.plugins.gif.GIFImageWriterSpi</value>
				<value>com.sun.media.imageio.plugins.gif.GIFImageWriterSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<map>
				<entry key="COMPRESSION" value="NULL" />
				<entry key="COMPRESSION_RATE" value="NULL" />
			</map>
		</constructor-arg>
		<constructor-arg ref="ioInitializer" />
	</bean>

	<bean id="JPEGEncoder" class="org.geowebcache.io.codec.ImageEncoderImpl">
		<constructor-arg type="boolean" value="true" />
		<constructor-arg>
			<list>
				<value>image/jpeg</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<list>
				<value>com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageWriterSpi</value>
				<value>com.sun.imageio.plugins.jpeg.JPEGImageWriterSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<map>
				<entry key="COMPRESSION" value="JPEG" />
				<entry key="COMPRESSION_RATE" value="0.75" />
			</map>
		</constructor-arg>
		<constructor-arg ref="ioInitializer" />
	</bean>

	<bean id="TIFFEncoder" class="org.geowebcache.io.codec.ImageEncoderImpl">
		<constructor-arg type="boolean" value="false" />
		<constructor-arg>
			<list>
				<value>image/tiff</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<list>
				<value>it.geosolutions.imageioimpl.plugins.tiff.TIFFImageWriterSpi</value>
				<value>com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriterSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<map>
				<entry key="COMPRESSION" value="Deflate" />
				<entry key="COMPRESSION_RATE" value="0.75" />
			</map>
		</constructor-arg>
		<constructor-arg ref="ioInitializer" />
	</bean>

	<bean id="BMPEncoder" class="org.geowebcache.io.codec.ImageEncoderImpl">
		<constructor-arg type="boolean" value="true" />
		<constructor-arg>
			<list>
				<value>image/bmp</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<list>
				<value>com.sun.media.imageioimpl.plugins.bmp.BMPImageWriterSpi</value>
				<value>com.sun.imageio.plugins.bmp.BMPImageWriterSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<map>
				<entry key="COMPRESSION" value="NULL" />
				<entry key="COMPRESSION_RATE" value="NULL" />
			</map>
		</constructor-arg>
		<constructor-arg ref="ioInitializer" />
	</bean>

	<!--Decoders -->

	<bean id="PNGDecoder" class="org.geowebcache.io.codec.ImageDecoderImpl">
		<constructor-arg type="boolean" value="false" />
		<constructor-arg>
			<list>
				<value>image/png</value>
				<value>image/png; mode=24bit</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<list>
				<value>com.sun.media.imageioimpl.plugins.png.CLibPNGImageReaderSpi</value>
				<value>com.sun.imageio.plugins.png.PNGImageReaderSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg ref="ioInitializer" />
	</bean>

	<bean id="GIFDecoder" class="org.geowebcache.io.codec.ImageDecoderImpl">
		<constructor-arg type="boolean" value="true" />
		<constructor-arg>
			<list>
				<value>image/gif</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<list>
				<value>com.sun.imageio.plugins.gif.GIFImageReaderSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg ref="ioInitializer" />
	</bean>

	<bean id="JPEGDecoder" class="org.geowebcache.io.codec.ImageDecoderImpl">
		<constructor-arg type="boolean" value="true" />
		<constructor-arg>
			<list>
				<value>image/jpeg</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<list>
				<value>com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi</value>
				<value>com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg ref="ioInitializer" />
	</bean>

	<bean id="TIFFDecoder" class="org.geowebcache.io.codec.ImageDecoderImpl">
		<constructor-arg type="boolean" value="false" />
		<constructor-arg>
			<list>
				<value>image/tiff</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<list>
				<value>it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi</value>
				<value>com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg ref="ioInitializer" />
	</bean>

	<bean id="BMPDecoder" class="org.geowebcache.io.codec.ImageDecoderImpl">
		<constructor-arg type="boolean" value="true" />
		<constructor-arg>
			<list>
				<value>image/bmp</value>
			</list>
		</constructor-arg>
		<constructor-arg>
			<list>
				<value>com.sun.media.imageioimpl.plugins.bmp.BMPImageReaderSpi</value>
				<value>com.sun.imageio.plugins.bmp.BMPImageReaderSpi</value>
			</list>
		</constructor-arg>
		<constructor-arg ref="ioInitializer" />
	</bean>

	<bean id="decoderContainer" class="org.geowebcache.io.codec.ImageDecoderContainer" />

	<bean id="encoderContainer" class="org.geowebcache.io.codec.ImageEncoderContainer" />
  
  
  
</beans>
